;(function($) {
  $("#slideBox").slide({
    mainCell: ".bd ul",
    effect: "fold",
    trigger: "click",
    autoPlay: true,
    mouseOverStop: false,
    startFun: function (i, c) {
    }
  });
  $('#j_button').on('click', function() {
    var $form = $('#form');
    var name = $form.find('input[name="name"]').val();
    var tel = $form.find('input[name="tel"]').val();
    var education = $form.find('input[name="education"]:checked').val()
    var major = $form.find('input[name="major"]:checked').val()
    var experience = $form.find('input[name="experience"]:checked').val()


    if ($.trim(name) === '') {
      layer.alert('请输入您的姓名!', {
        icon: 2,
        skin: 'layer-ext-moon' //该皮肤由layer.seaning.com友情扩展。关于皮肤的扩展规则，去这里查阅
      })
      return false;
    }
    if ($.trim(tel) === '') {
      layer.alert('请输入您的手机!', {
        icon: 2
      })
      return false;
    }
    if (!(/^1[34578]\d{9}$/.test(form.tel.value))) {
      layer.alert('请输入正确的手机号码！!', {
        icon: 2
      })
      return false;
    }
    $.ajax({
      url: ajaxUrl, // #
      type: 'post',
      data: {
        education:education,
        major:major,
        experience:experience,        
        name: name,
        tel: tel
      },
      dataType: 'json',
      success: function(data) {
        if (data.status === 1) {
          layer.alert('提交成功!', {
            icon: 1
          })
        }
      }
    })
  })
  
  $('.main').on('click', function(){
	  window.open('http://dbt.zoosnet.net/LR/Chatpre.aspx?id=DBT34483752&lng=cn', '_blank')
  })
  
  $('.conditions .item .btn').on('click', function(){
	  window.open('http://dbt.zoosnet.net/LR/Chatpre.aspx?id=DBT34483752&lng=cn', '_blank')
  })
})(jQuery)
